package controllers

import (
	//"fmt"
	"github.com/astaxie/beego"
)

type MessageController struct {
	beego.Controller
	Msg string
}

func (this *MessageController) Get() {
	this.Msg = this.GetString("msg")
	switch this.Msg {
	case "loginerr":
		this.Data["title"] = "登录失败"
		this.Data["content"] = "请返回登录页重新登陆."
	case "accountexist":
		this.Data["title"] = "账号已经存在"
		this.Data["content"] = "您正在注册的账号已经存在,请尝试其它账号."
	case "registersucess":
		this.Data["title"] = "注册成功"
		this.Data["content"] = "请返登录页进行登录."
	case "not found":
		this.Data["title"] = "用户不存在"
		this.Data["content"] = "请返回登录页重新登陆."
	default:
		this.Data["title"] = "非正常错误"
		this.Data["content"] = "错误信息:" + this.Msg
	}

	this.TplNames = "message.html"
}
